#include "windowlpcc.h"
#include "ui_windowlpcc.h"

WindowLPCC::WindowLPCC(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::WindowLPCC)
{
    ui->setupUi(this);
}
WindowLPCC::WindowLPCC(std::vector<double> &ti,
                       std::vector<std::vector<double>>& lpccFp,
                       std::vector<std::vector<double>>&lpcc_dFp,
                       std::vector<std::vector<double>>&lpcc_ddFp,QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::WindowLPCC)
{
    ui->setupUi(this);
    ui->textBrowser->clear(); // clear 清空文本框
    QString tmpText = "";

    tmpText += "time | LPCC | LPCC_d | LPCC_dd \n";

    for (uint i = 0; i < ti.size(); ++ i) {

        tmpText += QString::number(ti[i]) + " | ";
        for (uint j = 0; j < lpccFp[i].size(); ++ j) {
            tmpText += QString::number(lpccFp[i][j]) + " ";
        }
        tmpText += "| ";
        for (uint j = 0; j < lpcc_dFp[i].size(); ++ j) {
            tmpText += QString::number(lpcc_dFp[i][j]) + " ";
        }
        tmpText += "| ";
        for (uint j = 0; j < lpcc_ddFp[i].size(); ++ j) {
            tmpText += QString::number(lpcc_ddFp[i][j]) + " ";
        }
        tmpText += "\n";
    }
    ui->textBrowser->append(tmpText);
}

WindowLPCC::~WindowLPCC()
{
    delete ui;
}
